<?php


namespace app\home\model;

/**
 * Class MaterialDossier
 * @package app\home\model
 * 物料
 */
class MaterialDossier extends Base
{
    public function craftRoute()
    {
        return $this->hasMany(CraftRoute::class,'material_dossier_id','id')
            ->where('status',1);
}

    public function bom()
    {
        return $this->hasMany(Bom::class,'material_dossier_id','id')
            ->where('status',1);
}

    public function cangwei()
    {
        return $this->hasMany(WarehouseDetail::class,'warehouse_id','warehouse_id')
            ->where('status',1)->field('id,warehouse_id,name');
}

}